<?php

/*
 * site/test_service.php
 *
 * test service rpc calling
 */

Service::register( 'TestService', 'Test service', 'this is a test service' );

class TestService extends Service
{
	function __construct()
	{
		parent::__construct();
		$this->registerMethod( 'methodNoArg', array(), 'method without arguments', 'helpless', true );
		$this->registerMethod( 'methodNoArg2', array(), 'method 2 without arguments', 'helpless', false );
		$this->registerMethod( 'methodWithArg', array(T_INT, T_INT), 'method with arguments', 'still helpless' );
	}

	function methodNoArg()
	{
		return array( 'mystring'=> 'super content je suis!' );
		//return 'super content je suis!';
	}

	function methodNoArg2()
	{
		return array( 'mystring'=> 'super content je suis!' );
	}

	function methodWithArg( $a, $b )
	{
		$subtest = array( 'SubString'=> 'this is SubString 0', 'SubDouble'=>12.5 );
		$subtest1 = array( 'SubString'=> 'this is SubString 1', 'SubDouble'=>12.5 );
		$subtest2 = array( 'SubString'=> 'this is SubString 2', 'SubDouble'=>12.5 );
		return array( 'String'=> 'YOUPLAH TRALALALA!!!! '.time().' a0='.$a.' a1='.$b, 'Double'=>1.2, 'SubTest'=>array($subtest, $subtest1, $subtest2) );
	}

}


?>
